﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Noria.Encode.Convert
{
    class Program
    {
        static void Main(string[] args)
        {
            if (ParseParam(args))


                try
                {
                    NormalizateManager.NormalizateFiles();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            else
                ShowUsage();
        }

        private static bool ParseParam(string[] args)
        {
            if (args.Length == 1)
            {
                GlobalConfig.RootPath = args[0];
                GlobalConfig.WriteBOM = false;
                return true;
            }
            else if (args.Length == 2)
            {
                GlobalConfig.RootPath = args[0];
                GlobalConfig.WriteBOM = true;
                return true;
            }
            else
            {
                return false;
            }
        }

        private static void ShowUsage()
        {
            Console.WriteLine("ppdie [path] <bom>");
        }
    }
}
